home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #1 / Amiga Plus CD - 2000 - No. 1.iso / Tools / Grafik / Paint / Perfectpaint / rexx / circle / Sun.rx < prev    next >
Encoding:
Text File  |  1999-12-03  |  1.2 KB  |  79 lines

  1. /* Script Rexx
  2.     Make Star
  3. */
  4.  
  5.     call addlib("rexxmathlib.library", 5, -30, 0)
  6.  
  7.     options results
  8.   parse ARG Port x1 y1 r b
  9.     ADDRESS value Port
  10.  
  11.     pp_UpdateUndo
  12.  
  13.     r2=r/3
  14.     Pi=3.1415926/180
  15.  
  16.     pp_DialogInit 250 125 "*Sun*" 4
  17.         pp_Integer 0 110 5 50 16 "Number*of*Point*" 1 3
  18.         pp_Cycle 1 110 25 100 16 "Option" 1 "Filled|Unfilled" 0
  19.         pp_Integer 2 110 50 50 16 "Sun*Radius" 1 trunc(r2)
  20.         pp_Cycle 3 110 70 100 16 "Ray*Lenght" 1 "Random|Regular" 0        
  21.     pp_Dialog
  22.     rc=result
  23.     if rc=0 then
  24.         do
  25.             EXIT
  26.         end        
  27.         
  28.     pp_GetDialog 0
  29.     s0=result
  30.  
  31.     pp_GetDialog 1
  32.     s1=result
  33.  
  34.     pp_GetDialog 2
  35.     r2=result
  36.  
  37.     pp_GetDialog 3
  38.     Ray=result
  39.  
  40.     a=360/s0
  41.     a2=a/2
  42.  
  43.   DO i=0 To 359 by a
  44.         if ray=0 then 
  45.         do
  46.             r3=random(trunc(r2),r,time('S'))+5
  47.         end
  48.         else
  49.         do
  50.         r3=r
  51.         end
  52.  
  53.       x = Sin(i*Pi)*r3+x1
  54.     y = Cos(i*Pi)*r3+y1
  55.  
  56.         ii=i+a2
  57.       x2 = Sin(ii*Pi)*r2+x1
  58.     y2 = Cos(ii*Pi)*r2+y1
  59.  
  60.         ii=i-a2
  61.       x3 = Sin(ii*Pi)*r2+x1
  62.     y3 = Cos(ii*Pi)*r2+y1
  63.  
  64.         if s1=0 then do
  65.         pp_SplineF trunc(x3+0.5) trunc(y3+0.5) trunc(x2+0.5) trunc(y2+0.5) trunc(x+0.5) trunc(y+0.5)
  66.         end
  67.         else do
  68.         pp_Spline trunc(x3) trunc(y3) trunc(x2) trunc(y2) trunc(x) trunc(y)
  69.         end
  70.         
  71.  
  72.     END
  73.  
  74.         if s1=0 then do
  75.             pp_CircleF x1 y1 trunc(r2+0.5)+2
  76.       end
  77.  
  78.  
  79.